﻿
namespace ShpMerger
{
    internal class OneInfo
    {
        private int infoCount;
        public OneInfoHeader InfoHeader { private set; get; }

        public OneInfo()
        {
            InfoHeader = new OneInfoHeader();
            infoCount = 1;
        }

        public void AddInfo(ExtendBinaryReader binaryReader, 
                ExtendBinaryWriter binaryWriter)
        {
            InfoHeader.ReadInfoHeader(binaryReader);
            InfoHeader.InfoNumber = infoCount;
            InfoHeader.WriteInfoHeader(binaryWriter);
            ++ infoCount;
            for (int i = 1; i <= InfoHeader.InfoLength / 2; i++)
            {
                binaryWriter.Write(binaryReader.ReadInt32());
            }
        }
    }
}
